<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>会员收藏</title>
    <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>
<body>
<div class="layui-panel" style="padding: 8px;">
    <fieldset class="layui-elem-field layui-border-blue">
        <legend>搜索信息</legend>
        <form class="layui-form layui-form-pane" style="margin: 20px;">
            <div class="layui-form-item">
                <div class="layui-inline">

                    <div class="layui-input-inline">
                        <input class="layui-input" type="text" name="name" id="demoReload" autocomplete="off" placeholder="请输入用户ID"/>
                    </div>
                    <div class="layui-input-inline">
                        <input class="layui-input" type="text" name="name1" id="demoReload1" autocomplete="off" placeholder="请输入商品ID" />
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <a class="layui-btn layui-btn-primary" data-type="reload" lay-submit="" lay-filter="searchBtn">
                            <i class="layui-icon layui-icon-search"></i>
                            搜索
                        </a>
                    </div>
                </div>
            </div>
        </form>
    </fieldset>
    <div>
        <table id="collectionTable" lay-filter="collectionTable"></table>
    </div>

</div>

<script>

    layui.use(['table','form'],function () {
        var table=layui.table,
        form=layui.form;
        table.render({
            elem:'#collectionTable',
            height:'full-160',
            url:'/system/col/find',
            toolbar:true,
            page: {
                limit:13
            },
            cols:[
                [
                    {field:"userNameId",title:"用户ID"},
                    {field:"comNameId",title:"商品ID"},
                    {field:"createTime",title:"创建时间"},
                ]
            ],

        })
        form.on('submit(searchBtn)',function (data) {
            var dataForm=data.field
            table.reload('collectionTable', {
                where: {
                    userNameId:dataForm.name,
                    comNameId:dataForm.name1
                },
                page:{
                    curr:1
                }

            });

        })

    });
</script>
</body>
</html>